import React from 'react';

import { useHistory } from 'react-router-dom';

import { Button } from 'antd';

function PageTitle({ title, showBack = false }) {
    const history = useHistory();
    return (
        <div className="content-title">
            {
                showBack? <Button type="link" onClick={() => history.go(-1)}>返回</Button> : null
            }
            <span className="title">{title}</span>
        </div>
    )
}

export default React.memo(PageTitle);